﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WindowsGame1.CoreComponents;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace WindowsGame1
{
    class StartScreen : GameScreen
    {
        ButtonMenu buttonMenu;
        SpriteFont spriteFont;
        Texture2D background;
        Texture2D buttonImage;


        public StartScreen(Game1 game)
            : base(game)
        {
            LoadContent();
            Components.Add(new BackgroundComponent(game, background, true));
            string[] items = { "NEW GAME",
                                "LOAD GAME",
                                "HELP",
                                "CREDITS",
                                "QUIT" };
            buttonMenu = new ButtonMenu(game,spriteFont,buttonImage);
            buttonMenu.SetMenuItems(items);
            Components.Add(buttonMenu);
        }

        protected override void LoadContent()
        {
            background = Content.Load<Texture2D>(@"Backgrounds\titlescreen");
            buttonImage = Content.Load<Texture2D>(@"GUI\buttonbackground");
            spriteFont = Content.Load<SpriteFont>(@"normal");
            base.LoadContent();
        }

        public int SelectedIndex
        {
            get { return buttonMenu.SelectedIndex; }
        }

        public override void Show()
        {
            buttonMenu.Position = new Vector2((Game.Window.ClientBounds.Width -
            buttonMenu.Width) / 2, 450);
            base.Show();
        }

        public override void Hide()
        {
            base.Hide();
        }
    }
}